package com.hippomeetsskunk.savanna.model;

import com.hippomeetsskunk.savanna.types.world.Clima;
import com.hippomeetsskunk.savanna.types.world.Time;
import com.hippomeetsskunk.savanna.types.world.Weather;

public class WeatherModel {

	private MarkovModel markovModel = new MarkovModel();
	
	public void nextDay(Weather weather, Clima clima, Time time){
		
		final double expT = clima.getExpectedTemperature(time);
		final double expH = clima.getExpectedHumidity(time);
		
		final double nextT = markovModel.next(weather.getT(), expT, clima.getDailyTemperatureVariation());
		final double nextH = markovModel.next(weather.getH(), expH, clima.getDailyHumidityVariation());
		
		weather.setWeather(nextT, clima.getDayNightTemperatureVariation(), nextH);
	}
	
}
